package proto;


import com.sun.javafx.functions.Function0;
import javafx.async.RunnableFuture;


public class FunctionTaskRunnable implements RunnableFuture{
    private Function0<Void> func;

    public void setFunction(Function0<Void> fn){
        func = fn;
    }

    //@Override
    public void run() {
        if(func != null)
            func.invoke();
        else throw new IllegalStateException ("Function has not been specified");
    }
}
